
<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>H+ 后台主题UI框架 - 空白页</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="__STATIC__/layout/favicon.ico">
    <link href="__STATIC__/layout/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__STATIC__/layout/css/font-awesome.css?v=4.4.0" rel="stylesheet">
     <!-- jqgrid-->
    <link href="__STATIC__/layout/css/animate.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="__STATIC__/layout/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/gyq.css" rel="stylesheet">
    <link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
     <script src="__STATIC__/layout/js/jquery.min.js?v=2.1.4"></script>
    <script src="__STATIC__/sc/js/page.js"></script> 
</head>

<body style="color:#333;padding:3px;overflow-x: auto;">
    <!-- 标题 -->
    <div class="page-heade">
      <h2 class="title_color text-center">日常费用报销统计</h2>
    </div>
    <!-- 标题 -->
    <div class="">
    <form action="#" id="f1" class="form-inline formpage" method="post">
      <input type="hidden" value='{$page}' name="page" id="page-go"/>
                      <input type="hidden" value='{$list}' name="list" id="list-go"/>
      <table class="row-margin-top tab-content table-bordered  table text-left" border="1" style="margin:0">
          <tr>
            <td style="min-width: 160px;width: 160px" ><label for="" class="form-label">报销单号：</label></td>
            <td><input type="text" class="form-control" name="no" value="{$data.no}"></td>
              <td style="min-width: 160px;width: 160px" ><label for="" class="form-label">费用计入部门：</label></td>
            <td><input type="text" class="form-control" name="jrbm" value="{$data.jrbm}"></td>
              <td style="min-width: 160px;width: 160px" ><label for="" class="form-label">申请人：</label></td>
            <td><input type="text" class="form-control" name="shen" value="{$data.shen}"></td>
          </tr>
            <tr>
            <td style="min-width: 160px;width: 160px" ><label for="" class="form-label">一级费用科目：</label></td>
            <td><input type="text" class="form-control" name="kemu1" value="{$data.kemu1}"></td>
              <td style="min-width: 160px;width: 160px" ><label for="" class="form-label">二级费用科目：</label></td>
            <td><input type="text" class="form-control" name="kemu2" value="{$data.kemu2}"></td>
              <td style="min-width: 160px;width: 160px" ><label for="" class="form-label">三级费用科目：</label></td>
            <td><input type="text" class="form-control" name="kemu3" value="{$data.kemu3}"></td>
          </tr>
            <tr>
            <td style="min-width: 160px;width: 160px" ><label for="" class="form-label">归入财年：</label></td>
            <td><input type="text" class="form-control" name="cn" value="{$data.cn}"></td>
              <td style="min-width: 160px;width: 160px" ><label for="" class="form-label">归入考核期：</label></td>
            <td><input type="text" class="form-control" name="yue" value="{$data.yue}"></td>
              <td style="min-width: 160px;width: 160px" ><label for="" class="form-label">提交时间：</label></td>
            <td>
                <div class="form-group">
            <input type="text" id="start" class="form-control layer-date " style="display: inline-block;min-width: 120px;width: 120px" name="start" value="{$data.start}">
           </div>
            <div class="form-group">
                至
            </div>
           <div class="form-group">
            <input type="text" class="form-control layer-date"  style="display: inline-block;min-width: 120px;width: 120px" id="end" name="end" value="{$data.end}">
           </div>
            </td>
          </tr>
          <tr>
            <td colspan="6" class="text-center">
              <button class="btn-sm btn-info btn" type="button" id="check">查询</button>
              <button class="btn-sm btn-info btn" type="button" id="clear_check">清空查询条件</button>  
              <button class="btn btn-info btn-sm LendExcel" type="button" onclick="daochu({$did})">导出Excel</button>
            </td>
          </tr>
          <tr>
            <td colspan="6"></td>
          </tr>
      </table>
    
      <table class="table row-margin-top table-bordered table-hover text-center bud_hei">
          <tr class="info">
            <th style="min-width: 40px;width: 40px" class="text-center">NO.</th>
            <th style="min-width: 120px;width: 120px" class="text-center">报销单号</th>
            <th style="min-width: 120px;width: 120px" class="text-left">申请人</th>
            <th style="min-width: 120px;width: 120px" class="text-center">费用使用人</th>
            <th style="min-width: 120px;width: 120px" class="text-center">提交时间</th>
            <th style="min-width: 120px;width: 120px" class="text-right">归档时间</th>
            <th style="min-width: 120px;width: 120px" class="text-center">开始时间</th>
            <th style="min-width: 120px;width: 120px" class="text-center">结束时间</th>
            <th style="min-width: 140px;width: 140px" class="text-center">出发地点</th>
            <th style="min-width: 140px;width: 140px" class="text-center">到达地点</th>
            <th style="min-width: 120px;width: 120px" class="text-center">归入财年</th>
            <th style="min-width: 120px;width: 120px" class="text-center">归入考核期</th>
            <th style="min-width: 120px;width: 120px" class="text-center">一级费用科目</th>
            <th style="min-width: 120px;width: 120px" class="text-center">二级费用科目</th>
            <th style="min-width: 120px;width: 120px" class="text-center">三级费用科目</th>
            <th style="min-width: 120px;width: 120px" class="text-center">费用计入<br>部门</th>
            <th style="min-width: 220px;width: 220px" class="text-center">费用计入<br>经销商</th>
            <th style="min-width: 220px;width: 220px" class="text-center">费用说明</th>
            <th style="min-width: 120px;width: 120px" class="text-center">报销金额</th>

          </tr>
          {volist name="apply" id="vo" key="k"}
          <tr>
            <td>{$k}</td>
            <td><a class="J_menuItem detail" title="{$vo.no}" href="{:url('Richangbaoxiao/detail')}?aid={$vo.id}">{$vo.no}</a></td>
            <td>{$vo.cman}</td>
            <td>{$vo.bman}</td>
            <td>{$vo.ctime}</td>
            <td>{$vo.guidangdate}</td>
            <td>{$vo.start}</td>
             <td>{$vo.end}</td>
             <td>{$vo.chufa}</td>
             <td>{$vo.mudi}</td>
             <td>{$vo.nian}</td>
             <td>{$vo.yue}</td>
             <td>{$vo.kemu1}</td>
             <td>{$vo.kemu2}</td>
             <td>{$vo.kemu3}</td>
             <td>{$vo.jrdap}</td>
             <td>{$vo.jxs}</td>
             <td>{$vo.remark}</td>
             <td class="ObjectNum">{$vo.pizhunfeiyong}</td>
          </tr>
         {/volist}  
      </table>
        <h5 class="text-center" id="pagesc" style="font-size: 16px;font-weight: 500">
            <script>
                            $(function(){
                                pageSC("pagesc",{$sum},{$page},{$maxpage})
                            })
                        </script> 
                         每页显示
           <select id="pagesize">
                        <option value='10' {if condition="$list eq 10"}selected{/if}>10条</option>
                        <option value='20'{if condition="$list eq 20"}selected{/if}>20条</option>
                        <option value='40'{if condition="$list eq 40"}selected{/if}>40条</option>

            </select>
        </h5>
</form>
    </div>
    <!-- 全局js -->
    <script src="__STATIC__/layout/js/bootstrap.min.js?v=3.3.6"></script>
    <!-- <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script> -->
    <script src="__STATIC__/layout/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
    <!--统计代码，可删除-->
    <script src="__STATIC__/layout/js/plugins/layer/laydate/laydate.js"></script>
       <script src="__STATIC__/layout/js/common.js"></script>
    <script>
    function daochu(did){
      window.open("{:url('Rcexecel/tongji')}?did="+did);
    }
        //翻页
     
        $("#check").click(function(){
              $("#page-go").val(1);
              $(".formpage").submit();
        })
        $("#clear_check").click(function(){
            $("input[type='text']").val("");
            $("select").val(0);
            $("#page-go").val(1);
            $(".formpage").submit();
        })
        //日期范围限制
        var start = {
            elem: '#start',
            format: 'YYYY-MM-DD',
           
            max: '2099-06-16 23:59:59', //最大日期
            istime: true,
            istoday: false,
            choose: function (datas) {
                end.min = datas; //开始日选好后，重置结束日的最小日期
                end.start = datas //将结束日的初始值设定为开始日
            }
        };
        var end = {
            elem: '#end',
            format: 'YYYY-MM-DD',
            
            max: '2099-06-16 23:59:59',
            istime: true,
            istoday: false,
            choose: function (datas) {
                start.max = datas; //结束日选好后，重置开始日的最大日期
            }
        };
        laydate(start);
        laydate(end);

        $(document).ready(function(){
            var $ObjectNum =$(".ObjectNum");
               toNum($ObjectNum);
        })
         $(document).ready(function () {

        $('#reset').on('click',function () {
            $("#form1 input").each(function(){
                $(this).val('');
            });
            $("#form1 select").each(function(){
                $(this).val('');
            });
            $('#form1').submit()
            return false
        })
    })   
    </script>

<script>
    $(".detail").click(menuItem);
    function menuItem() {
    // 获取标识数据
    var dataUrl = $(this).attr('href'),
        dataIndex = $(this).data('index'),
        menuName = $.trim($(this).attr("title")),
        flag = true;
    if (dataUrl == undefined || $.trim(dataUrl).length == 0)return false;

    // 选项卡菜单已存在
    top.$('.J_menuTab').each(function () {
        if ($(this).data('id') == dataUrl) {
            if (!$(this).hasClass('active')) {
                $(this).addClass('active').siblings('.J_menuTab').removeClass('active');
                scrollToTab(this);
                // 显示tab对应的内容区
                top.$('.J_mainContent .J_iframe').each(function () {
                    if (top.$(this).data('id') == dataUrl) {
                        top.$(this).show().siblings('.J_iframe').hide();
                        return false;
                    }
                });
            }
            flag = false;
            return false;
        }
    });

    // 选项卡菜单不存在
    if (flag) {
        var str = '<a href="javascript:;" class="active J_menuTab" data-id="' + dataUrl + '">' + menuName + ' <i class="fa fa-times-circle"></i></a>';
        top.$('.J_menuTab').removeClass('active');

        // 添加选项卡对应的iframe
        var str1 = '<iframe class="J_iframe" name="iframe' + dataIndex + '" width="100%" height="100%" src="' + dataUrl + '" frameborder="0" data-id="' + dataUrl + '" seamless></iframe>';
        top.$('.J_mainContent').find('iframe.J_iframe').hide().parents('.J_mainContent').append(str1);

        //显示loading提示
//            var loading = layer.load();
//
//            $('.J_mainContent iframe:visible').load(function () {
//                //iframe加载完成后隐藏loading提示
//                layer.close(loading);
//            });
        // 添加选项卡
        top.$('.J_menuTabs .page-tabs-content').append(str);
        scrollToTab(top.$('.J_menuTab.active'));
    }
    return false;
}
//滚动到指定选项卡
function scrollToTab(element) {
    var marginLeftVal = calSumWidth(top.$(element).prevAll()), marginRightVal = calSumWidth(top.$(element).nextAll());
    // 可视区域非tab宽度
    var tabOuterWidth = calSumWidth(top.$(".content-tabs").children().not(".J_menuTabs"));
    //可视区域tab宽度
    var visibleWidth = top.$(".content-tabs").outerWidth(true) - tabOuterWidth;
    //实际滚动宽度
    var scrollVal = 0;
    if (top.$(".page-tabs-content").outerWidth() < visibleWidth) {
        scrollVal = 0;
    } else if (marginRightVal <= (visibleWidth - top.$(element).outerWidth(true) - top.$(element).next().outerWidth(true))) {
        if ((visibleWidth - top.$(element).next().outerWidth(true)) > marginRightVal) {
            scrollVal = marginLeftVal;
            var tabElement = element;
            while ((scrollVal - top.$(tabElement).outerWidth()) > (top.$(".page-tabs-content").outerWidth() - visibleWidth)) {
                scrollVal -= top.$(tabElement).prev().outerWidth();
                tabElement = top.$(tabElement).prev();
            }
        }
    } else if (marginLeftVal > (visibleWidth - top.$(element).outerWidth(true) - top.$(element).prev().outerWidth(true))) {
        scrollVal = marginLeftVal - top.$(element).prev().outerWidth(true);
    }
    top.$('.page-tabs-content').animate({
        marginLeft: 0 - scrollVal + 'px'
    }, "fast");
}
//计算元素集合的总宽度
function calSumWidth(elements) {
    var width = 0;
    top.$(elements).each(function () {
        width += top.$(this).outerWidth(true);
    });
    return width;
}


    </script>
</body>

</html>
